package com.zhixing.map.controller;

import com.zhixing.common.domain.dto.RoutePlanningDTO;
import com.zhixing.common.domain.vo.RoutePlanningVO;
import com.zhixing.common.utils.Res;
import com.zhixing.map.service.MapService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 地图接口
 */
@Slf4j
@RestController
@RequestMapping("/map")
@RequiredArgsConstructor
public class MapController {

    private final MapService mapService;

    /**
     * 路线规划
     * @param routePlanningDTO 位置信息
     * @return RoutePlanningVO 路线规划信息
     */
    @GetMapping("/routePlanning")
    public Res<RoutePlanningVO> routePlanning(@Validated RoutePlanningDTO routePlanningDTO) {
        log.info("地图服务调用，路线规划");
        return Res.ok(mapService.routePlanning(routePlanningDTO));
    }
}
